package edu.ccut.saturn.basevalidate.prvalidate;

import edu.ccut.saturn.component.DefaultSaturnValidate;
import edu.ccut.saturn.component.ValidateResult;

public class IsIdentityValidate extends DefaultSaturnValidate {

	private static final String identityRegExpr = "\\d{15}|\\d{17}[x0-9]";

	public void doValidate(Object value, Object[] args, ValidateResult result) {
		if (!(value.toString()).matches(identityRegExpr)) {
			sendError(_ERROR_, value, result);
		}
	}
}
